package com.landian.commons.jpa.utils;

import com.querydsl.core.types.Path;

/**
 * StringPathUtils
 *
 * @author caojl
 * @create 2017/11/21
 **/
public class PathUtils {

    /**
     * 获取对应的字段属性
     * @param path
     * @return
     */
    public static String getFieldName(Path<?> path){
        String fullName = path.toString();
        String fieldName = fullName.substring(fullName.lastIndexOf(".")  + 1);
        return fieldName;
    }
}
